package edu.task.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysMenuVO implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "menu_id")
    private Long menuId;

    @NotBlank(message = "菜单名称不能为空")
    @Size(min = 0,max = 50,message = "菜单名称长度不能超过50个字符")
    private String menuName;

    private Long parentId;

    @NotBlank(message = "顺序不能为空")
    private Integer orderNum;

    @Size(min = 0,max = 200,message = "路由地址不能超过200个字符")
    private String path;

    @Size(min = 0,max = 200,message = "组件路径不能超过200个字符")
    private String component;

    @Column(name = "is_frame")
    private Integer isFrame;

    @Column(name = "menu_type")
    private String menuType;

    @Column(name = "visible")
    private String visible;

    @Column(name = "perms")
    private String perms;

    @Column(name = "icon")
    private String icon;

    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private String remark;
    private List<SysMenuVO> children=new ArrayList<SysMenuVO>();
}
